home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / Chip 11-96.iso / workshop / howto / pcmcia < prev    next >
Text File  |  1996-05-26  |  49KB  |  1,188 lines

  1.   Linux PCMCIA HOWTO
  2.   David Hinds, dhinds@allegro.stanford.edu
  3.   v1.63, 27 December 1995
  4.  
  5.   This document describes how to install and use PCMCIA Card Services
  6.   for Linux, and answers some frequently asked questions.  The latest
  7.   version of this document can always be found at hyper.stanford.edu in
  8.   /pub/pcmcia/doc.  An HTML version is at
  9.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html
  10.  
  11.   1.  General information and hardware requirements
  12.  
  13.   1.1.  Introduction
  14.  
  15.   Card Services for Linux is a complete PCMCIA support package.  It
  16.   includes a set of loadable kernel modules that implement a version of
  17.   the PCMCIA Card Services applications program interface, a set of
  18.   client drivers for specific cards, and a card manager daemon that can
  19.   respond to card insertion and removal events, loading and unloading
  20.   drivers on demand.  It supports ``hot swapping'' of PCMCIA cards, so
  21.   cards can be inserted and ejected at any time.
  22.  
  23.   This software is still under development.  It probably contains bugs,
  24.   and should be used with caution.  I'll do my best to fix problems that
  25.   are reported to me, but if you don't tell me, I may never know.  If
  26.   you use this code, I hope you will send me your experiences, good or
  27.   bad!
  28.  
  29.   If you have any suggestions for how this document could be improved,
  30.   please let me know (dhinds@allegro.stanford.edu).
  31.  
  32.  
  33.   1.2.  Copyright notice and disclaimer
  34.  
  35.  
  36.   Copyright (c) 1995 David A. Hinds
  37.  
  38.   This document may be reproduced or distributed in any form without my
  39.   prior permission.  Parts of this document may be distributed, provided
  40.   that this copyright message and a pointer to the complete document are
  41.   included.  Specifically, it may be included in commercial
  42.   distributions without my prior consent.  However, I would like to be
  43.   informed of such usage.
  44.  
  45.   This document may be translated into any language, provided this
  46.   copyright statement is left intact.
  47.  
  48.   This document is provided ``as is'', with no explicit or implied
  49.   warranties.  Use the information in this document at your own risk.
  50.  
  51.  
  52.   1.3.  What is the latest version, and where can I get it?
  53.  
  54.   The current major release of Card Services is version 2.8, and minor
  55.   updates or bug fixes are numbered 2.8.1, 2.8.2, and so on.
  56.  
  57.   Source code for the latest version is available from
  58.   hyper.stanford.edu in the /pub/pcmcia directory, as pcmcia-
  59.   cs-2.8.?.tar.gz.  There will usually be several versions here.  I
  60.   generally only keep the latest minor release for a given major
  61.   release.  New major releases may contain relatively untested code, so
  62.   I also keep the latest version of the previous major release as a
  63.   relatively stable fallback; the current fallback is 2.7.6.  It is up
  64.   to you to decide which version is more appropriate, but the CHANGES
  65.   file will summarize the most important differences.
  66.  
  67.   hyper.stanford.edu is mirrored at sunsite.unc.edu in
  68.   /pub/Linux/kernel/pcmcia.  I'll also try to upload major releases to
  69.   tsx-11.mit.edu under /pub/linux/packages/laptops/pcmcia now and then.
  70.  
  71.   If you do not feel up to compiling the PCMCIA drivers from scratch,
  72.   pre-compiled drivers are included with current releases of most of the
  73.   major Linux distributions, including Slackware, Red Hat, Caldera, and
  74.   Yggdrasil, among others.
  75.  
  76.  
  77.   1.4.  What systems are supported?
  78.  
  79.   This code should run on almost any Linux-capable laptop.  All common
  80.   PCMCIA controllers are supported, including Intel, Cirrus, Vadem,
  81.   VLSI, Ricoh, and Databook chips.  Custom controllers used in IBM and
  82.   Toshiba laptops are also supported.  Several people use the package on
  83.   desktop systems with PCMCIA card adapters.
  84.  
  85.   The Motorola 6AHC05GA controller used in some Hyundai laptops is not
  86.   supported.  The custom PCMCIA controller in the HP Omnibook 600 is
  87.   also unsupported.
  88.  
  89.  
  90.   1.5.  What PCMCIA cards are supported?
  91.  
  92.   The current release includes drivers for a variety of ethernet cards,
  93.   a driver for modem and serial port cards, several SCSI adapter
  94.   drivers, and memory card drivers that should support most SRAM cards
  95.   and some flash cards.  The SUPPORTED.CARDS file included with each
  96.   release of Card Services lists all cards that are known to work in at
  97.   least one actual system.
  98.  
  99.   The likelihood that a card not on the supported list will work depends
  100.   on the type of card.  Essentially all modems should work with the
  101.   supplied driver.  Some network cards may work if they are OEM versions
  102.   of supported cards.  Other types of IO cards (hard drives, sound
  103.   cards, etc) will not work until someone writes the appropriate
  104.   drivers.
  105.  
  106.  
  107.   1.6.  When will card X be supported?
  108.  
  109.   Unfortunately, they do not pay me to write device drivers, so if you
  110.   would like to have a driver for your favorite card, you are probably
  111.   going to have to do at least some of the work.  The SUPPORTED.CARDS
  112.   file mentions some cards for which driver work is currently in
  113.   progress.  I will try to help where I can.
  114.  
  115.  
  116.   1.7.  Mailing list
  117.  
  118.   I maintain a database and mailing list of Linux PCMCIA users.  This is
  119.   used to announce new releases of the PCMCIA package.  To be included,
  120.   send me the following:
  121.  
  122.  
  123.   o  Your name and email address
  124.  
  125.   o  What kind of laptop are you using?
  126.  
  127.   o  What PCMCIA controller is reported by the probe command?
  128.  
  129.   o  What PCMCIA cards are you using?
  130.  
  131.   o  Any special settings you use: compilation options, irq and port
  132.      settings, /etc/pcmcia/config.opts changes, insmod options, etc.
  133.   You can also register via the WWW: see
  134.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html for instructions.
  135.  
  136.   There is also a Linux mailing list devoted to laptop issues, the
  137.   ``linux-laptop'' list.  For more information, send a message
  138.   containing the word ``help'' to majordomo@vger.rutgers.edu.
  139.  
  140.  
  141.   2.  Compilation, installation, and configuration
  142.  
  143.   2.1.  Prerequisites and kernel setup
  144.  
  145.   The following things should be installed on your system before you
  146.   start installing PCMCIA:
  147.  
  148.   o  One of the following kernels: 1.2.8 through 1.2.13, 1.3.30, 1.3.37,
  149.      or 1.3.39 through 1.3.45.
  150.  
  151.   o  A current (1.2.8) set of module utilities.
  152.  
  153.   o  (Optional) the ``Forms'' X11 user interface toolkit.
  154.  
  155.   The latest version requires a kernel version 1.2.8 or higher, or a
  156.   development kernel 1.3.30 or higher.  It has been tested with 1.3.30,
  157.   1.3.37, 1.3.39, 1.3.43, and 1.3.45.  1.3.38 is definitely broken, and
  158.   1.3.31 to 1.3.36 are untested.  It also requires a relatively recent
  159.   set of module utilities.  If your man page for insmod describes the
  160.   [symbol=value ...] syntax, your utilities are current enough.  There
  161.   are no kernel patches specifically for PCMCIA.
  162.  
  163.   You need to have a complete linux source tree for your kernel, not
  164.   just an up-to-date kernel image, to compile the PCMCIA package.  The
  165.   PCMCIA modules contain some references to kernel source files.  While
  166.   you may want to build a new kernel to remove unnecessary drivers,
  167.   installing PCMCIA does not require you to do so.
  168.  
  169.   Current kernel sources and patches are available from sunsite.unc.edu
  170.   in /pub/Linux/kernel/v1.2, or from tsx-11.mit.edu in
  171.   /pub/linux/sources/system/v1.2.  Current module utilities can be found
  172.   in the same places, in the file modules-1.2.8.tgz.
  173.  
  174.   When configuring your kernel, if you plan on using a PCMCIA ethernet
  175.   card, you should turn on networking support but turn off the normal
  176.   Linux network card drivers, including the ``pocket and portable
  177.   adapters''.  The PCMCIA network card drivers are all implemented as
  178.   loadable modules.  Any drivers compiled into your kernel will only
  179.   waste space.
  180.  
  181.   If you want to use SLIP, PPP, or PLIP, you do need to either configure
  182.   your kernel with these enabled, or use the loadable module versions of
  183.   these drivers.  There is an unfortunate deficiency in the kernel
  184.   config process in 1.2.X kernels, in that it is not possible to set
  185.   configuration options (like SLIP compression) for a loadable module,
  186.   so it is probably better to just link SLIP into the kernel if you need
  187.   it.
  188.  
  189.   If you will be using a PCMCIA SCSI adapter, you should enable
  190.   CONFIG_SCSI when configuring your kernel.  Also, enable any top level
  191.   drivers (SCSI disk, tape, cdrom, generic) that you expect to use.  All
  192.   low-level drivers for particular host adapters should be disabled, as
  193.   they will just take up space.
  194.  
  195.   If your kernel is compiled with CONFIG_MODVERSIONS enabled, for kernel
  196.   symbol version checking, the configure script will check for the
  197.   existence of /usr/include/linux/modversions.h, the symbol version
  198.   database.  This is created by running ``make dep'' in the kernel
  199.   source tree.
  200.  
  201.   This package includes an X-based card status utility called cardinfo.
  202.   This utility is based on a public domain user interface toolkit called
  203.   the Forms Library, which you will need to install before building
  204.   cardinfo.  A binary distribution is on hyper.stanford.edu in
  205.   /pub/pcmcia/extras: there are both a.out and ELF versions of the
  206.   library.
  207.  
  208.  
  209.   2.2.  Installation
  210.  
  211.  
  212.   Here is a synopsis of the installation process:
  213.  
  214.  
  215.   o  Unpack pcmcia-cs-2.8.?.tar.gz in /usr/src.
  216.  
  217.   o  Run ``make config'' in the new pcmcia-cs-2.8.? directory.
  218.  
  219.   o  Run ``make all'', then ``make install''.
  220.  
  221.   o  Customize /etc/rc.d/rc.pcmcia and the files in /etc/pcmcia for your
  222.      site.
  223.  
  224.   Running ``make config'' prompts for a few configuration options, and
  225.   checks out your system to verify that it satisfies all prerequisites
  226.   for installing PCMCIA support.  In most cases, you'll be able to just
  227.   accept all the default configuration options.  Be sure to carefully
  228.   check the output of this command in case there are problems.
  229.  
  230.   If you are compiling the PCMCIA stuff for installation on another
  231.   machine, specify an alternate target directory when prompted by the
  232.   configure script.  This should be an absolute path.  All the PCMCIA
  233.   tools will be installed relative to this directory.  You will then be
  234.   able to tar this directory tree and copy to your target machine, and
  235.   unpack relative to its root directory to install everything in the
  236.   proper places.
  237.  
  238.   If you are cross compiling on another machine, you may want to specify
  239.   alternate names for the compiler and linker.  This may also be helpful
  240.   on mixed a.out and ELF systems.  The script will also prompt for
  241.   additional compiler flags for debugging.
  242.  
  243.   There are a few kernel configuration options that affect the PCMCIA
  244.   tools.  The configuration script can deduce these from the running
  245.   kernel (the most common case).  Alternatively, if you are compiling
  246.   for installation on another machine, it can read the configuration
  247.   from a kernel source tree, or each option can be set interactively.
  248.  
  249.   Running ``make all'' followed by ``make install'' will build and then
  250.   install the kernel modules and utility programs.  Kernel modules are
  251.   installed under /lib/modules/<version>/pcmcia.  The cardmgr and
  252.   cardctl programs are installed in /sbin.  If cardinfo is built, it is
  253.   installed in /usr/bin/X11.
  254.  
  255.   Configuration files will be installed in the /etc/pcmcia directory.
  256.   If you are installing over an older version, the new config files will
  257.   be installed with a ``.N'' suffix -- you should replace or update your
  258.   existing files by hand.
  259.  
  260.   If you don't know what kind of PCMCIA controller chip you have, you
  261.   can use the probe utility in the cardmgr/ subdirectory to determine
  262.   this.  There are two major types: the Databook TCIC-2 type and the
  263.   Intel i82365SL-compatible type.
  264.  
  265.   A user-level daemon processes card insertion and removal events.  This
  266.   is called cardmgr.  It is similar in function to Barry Jaspan's
  267.   pcmciad in earlier PCMCIA releases.  Cardmgr reads a configuration
  268.   file describing known PCMCIA cards from /etc/pcmcia/config.  This file
  269.   also specifies what resources can be allocated for use by PCMCIA
  270.   devices, and may need to be customized for your system.  See the
  271.   pcmcia man page for more information about this file.
  272.  
  273.   The script rc.pcmcia, installed in /etc/rc.d, controls starting up and
  274.   shutting down the PCMCIA system.  ``make install'' will use the probe
  275.   command to determine your controller type and modify rc.pcmcia
  276.   appropriately.  You should add a line to your system startup file
  277.   /etc/rc.d/rc.M to invoke this:
  278.  
  279.  
  280.  
  281.        /etc/rc.d/rc.pcmcia start
  282.  
  283.  
  284.  
  285.  
  286.   In a few cases, the probe command will be unable to determine your
  287.   controller type automatically.  The Tadpole P1000 and some other PCI-
  288.   based laptops have a special Cirrus PCI-to-PCMCIA bridge chip that
  289.   can't be detected by probe.  If you have one of these systems, you'll
  290.   need to edit rc.pcmcia by hand to load the i82365 module.
  291.  
  292.  
  293.   2.3.  Site-specific configuration options
  294.  
  295.   Card Services should automatically avoid allocating IO ports and
  296.   interrupts already in use by other standard devices.  It will also
  297.   attempt to detect conflicts with unknown devices, but this is not
  298.   completely reliable.  In some cases, you may need to explicitly
  299.   exclude resources for a device in /etc/pcmcia/config.opts.
  300.  
  301.   Here are some resource settings for specific laptop types.
  302.  
  303.  
  304.   o  On the AMS SoundPro, exclude irq 10.
  305.  
  306.   o  On the BMX 486DX2-66, exclude irq 5, irq 9.
  307.  
  308.   o  On the Chicony NB5, use memory 0xda000-0xdffff.
  309.  
  310.   o  On the NEC Versa M, exclude irq 9, port 0x2e0-2ff.
  311.  
  312.   o  On the NEC Versa P/75, exclude irq 5, irq 9.
  313.  
  314.   o  On the NEC Versa S, exclude irq 9, irq 12.
  315.  
  316.   o  On the ProStar 9200, Altima Virage, and Acquiline Hurricane
  317.      DX4-100, exclude irq 5, port 0x330-0x35f.  Maybe use memory
  318.      0xd8000-0xdffff.
  319.  
  320.   o  On the TI TravelMate 5000, use memory 0xd4000-0xdffff.
  321.  
  322.   o  On the Toshiba T4900 CT, exclude irq 5, port 0x2e0-0x2e8, port
  323.      0x330-0x338.
  324.  
  325.   o  On the Twinhead 5100, HP 4000, Sharp PC-8700 and PC-8900, exclude
  326.      irq 9 (sound), irq 12.
  327.  
  328.   o  On an MPC 800 Series, exclude irq 5, port 0x300-0x30f for the CD-
  329.      ROM.
  330.  
  331.   Some PCMCIA controllers have optional features that may or may not be
  332.   implemented in a particular system.  It is generally impossible for a
  333.   socket driver to detect if these features are implemented.  Check the
  334.   man page for your driver to see what optional features may be enabled.
  335.  
  336.   The low level socket drivers, tcic and i82365, have numerous bus
  337.   timing parameters that may need to be adjusted for systems with
  338.   particularly fast processors.  Symptoms of timing problems include
  339.   card recognition problems, lock-ups under heavy loads, high error
  340.   rates, or poor device performance.  Check the corresponding man pages
  341.   for more details, but here is a brief summary:
  342.  
  343.  
  344.   o  Cirrus controllers have numerous configurable timing parameters.
  345.      The most important is the freq_bypass flag which changes the
  346.      multiplier for the PCMCIA bus clock to slow down all operations.
  347.  
  348.   o  The Cirrus PD6729 PCI controller has the fast_pci flag, which
  349.      should be set if the PCI bus speed is greater than 25 MHz.
  350.  
  351.   o  For Vadem VG-468 controllers and Databook TCIC-2 controllers, the
  352.      async_clock flag changes the relative clocking of PCMCIA bus and
  353.      host bus cycles.  Setting this flag adds extra wait states to some
  354.      operations.
  355.  
  356.   o  The pcmcia_core module has the cis_speed parameter for changing the
  357.      memory speed used for accessing a card's Card Information Structure
  358.      (CIS).  On some systems with fast bus clocks, increasing this
  359.      parameter (i.e., slowing down card accesses) may be beneficial.
  360.  
  361.   All these options should be configured by modifying the top of
  362.   /etc/rc.d/rc.pcmcia.  For example:
  363.  
  364.  
  365.  
  366.        # Should be either i82365 or tcic
  367.        PCIC=i82365
  368.        # Put socket driver timing parameters here
  369.        PCIC_OPTS="async_clock=1"
  370.        # Put pcmcia_core options here
  371.        CORE_OPTS="cis_speed=500"
  372.  
  373.  
  374.  
  375.  
  376.   On some systems using Cirrus controllers, including the NEC Versa M,
  377.   the BIOS puts the controller in a special suspended state at system
  378.   startup time.  On these systems, the probe command will fail to find
  379.   any known PCMCIA controller.  If this happens, edit
  380.   /etc/rc.d/rc.pcmcia by hand as follows:
  381.  
  382.  
  383.  
  384.        # Should be either i82365 or tcic
  385.        PCIC=i82365
  386.        # Put socket driver timing parameters here
  387.        PCIC_OPTS="wakeup=1"
  388.  
  389.  
  390.  
  391.  
  392.   If you have an ARM Pentium-90 or Midwest Micro Soundbook Plus laptop,
  393.   use the combination ``freq_bypass=1 cmd_time=8'' to slow down your
  394.   PCMCIA bus cycles.  On a Midwest Micro Soundbook Elite, try
  395.   ``cmd_time=12''.  These may help on other very fast systems that use
  396.   the non-PCI Cirrus chip (the PD672x).
  397.   2.4.  What about installation on Red Hat and Caldera?
  398.  
  399.   Red Hat and Caldera have a System V-ish arrangement for system startup
  400.   files.  The PCMCIA installation scripts will automatically detect this
  401.   and adjust accordingly.  The rc.pcmcia script will be installed as
  402.   /etc/rc.d/init.d/pcmcia.  There is no need to edit any of the Caldera
  403.   startup scripts to enable PCMCIA: it will happen automatically.
  404.  
  405.   A separate configuration file, /etc/sysconfig/pcmcia, will be created
  406.   for startup options.  If you need to change any module options (like
  407.   the PCIC= or PCIC_OPTS= settings), edit this config file rather than
  408.   the actual PCMCIA startup script.  This file will not be overwritten
  409.   by subsequent installs.
  410.  
  411.   Previous releases used the /etc/sysconfig/pcmcia-scripts directory in
  412.   place of /etc/pcmcia.  The current release instead uses /etc/pcmcia
  413.   for all systems, and will move /etc/sysconfig/pcmcia-scripts to
  414.   /etc/pcmcia if it is present.
  415.  
  416.  
  417.   2.5.  Why don't you distribute PCMCIA binaries?
  418.  
  419.   For me, distributing binaries is a significant hassle.  It is
  420.   complicated because some features can only be selected at compile
  421.   time, and because the PCMCIA modules are somewhat dependent on having
  422.   the ``right'' kernel configuration.  So, I would probably need to
  423.   distribute precompiled modules along with matching kernels.  Beyond
  424.   this, the greatest need for precompiled modules is when installing
  425.   Linux on a clean system.  This typically requires setting up PCMCIA so
  426.   that it can be used in the installation process for a particular Linux
  427.   distribution.  Each Linux distribution has its own procedures, and it
  428.   is not feasible for me to provide boot and root disks for even just
  429.   the common combinations of drivers and distributions.
  430.  
  431.   PCMCIA is now a part of many of the major Linux distributions,
  432.   including Red Hat, Caldera, Slackware, Yggdrasil, and Nascent
  433.   Technology.
  434.  
  435.  
  436.   2.6.  Problems loading kernel modules
  437.  
  438.   The configure script will normally ensure that the PCMCIA modules are
  439.   compatible with your kernel.  So, module loading problems generally
  440.   indicate that the user has interfered with the normal installation
  441.   process in some way.  Some module loading errors are sent directly to
  442.   the Linux console.  Other errors are recorded in the system log file,
  443.   normally /usr/adm/messages.  To track down a problem, be sure to check
  444.   both locations, to pin down which module is actually causing trouble.
  445.  
  446.   Some of the PCMCIA modules require kernel services that may or may not
  447.   be present, depending on kernel configuration.  For instance, the SCSI
  448.   card drivers require that the kernel be configured with SCSI support,
  449.   and the network drivers require a networking kernel.  If a kernel
  450.   lacks a necessary feature, insmod may report undefined symbols and
  451.   refuse to load a module.
  452.  
  453.   If insmod reports ``wrong version'' errors, it means that the module
  454.   was compiled for a different kernel version than your system is
  455.   actually running.  This might occur if modules compiled on one machine
  456.   are copied to another machine with a different configuration, or if
  457.   the kernel is reconfigured after PCMCIA is installed.
  458.  
  459.   A final source of module loading errors is when the modules and kernel
  460.   were compiled with different settings of CONFIG_MODVERSIONS.  If a
  461.   module with version checking is loaded against a kernel without
  462.   version checking, insmod will complain about undefined symbols.
  463.   2.7.  Problems with the card status change interrupt
  464.  
  465.   In most cases, the socket driver (i82365 or tcic) will automatically
  466.   probe and select an appropriate interrupt to signal card status
  467.   changes.  The automatic interrupt probe doesn't work on some Intel-
  468.   compatible controllers, including Cirrus chips and the chips used in
  469.   some IBM ThinkPads.  If a device is inactive at probe time, its
  470.   interrupt may also appear to be available.  In these cases, the socket
  471.   driver may pick an interrupt that is used by another device.
  472.  
  473.   With the i82365 and tcic drivers, the irq_mask option can be used to
  474.   limit the interrupts that will be tested.  This mask limits the set of
  475.   interrupts that can be used by PCMCIA cards as well as for monitoring
  476.   card status changes.  The cs_irq option can also be used to explicitly
  477.   set the interrupt to be used for monitoring card status changes.
  478.  
  479.   If you can't find an interrupt number that works, there is also a
  480.   polled status mode: both i82365 and tcic will accept a
  481.   poll_interval=100 option, to poll for card status changes once per
  482.   second.
  483.  
  484.   All these options should be set in the PCIC_OPTS= line in either
  485.   /etc/rc.d/rc.pcmcia or /etc/sysconfig/pcmcia, depending on your site
  486.   setup.
  487.  
  488.   The most common problem of this type seems to be a conflict with a
  489.   PS/2 pointer device on interrupt 12.  In this case, edit rc.pcmcia so
  490.   the PCIC_OPTS= line reads:
  491.  
  492.  
  493.  
  494.        PCIC_OPTS="irq_mask=0xefff"
  495.  
  496.  
  497.  
  498.  
  499.  
  500.   3.  Usage and features
  501.  
  502.   3.1.  How do I tell if it is working?
  503.  
  504.   The cardmgr daemon normally beeps when a card is inserted, and the
  505.   tone of the beeps indicates the status of the newly inserted card.
  506.   Two high beeps indicate the card was identified and configured
  507.   successfully.  A high beep followed by a lower beep indicates that the
  508.   card was identified, but could not be configured for some reason.  One
  509.   low beep indicates that the card could not be identified.
  510.  
  511.   If you are running X, the new cardinfo utility produces a slick
  512.   graphical display showing the current status of all PCMCIA sockets.
  513.  
  514.   If the modules are all loaded correctly, the output of the lsmod
  515.   command should look like the following, with no cards inserted:
  516.  
  517.  
  518.  
  519.        Module:        #pages:  Used by:
  520.        ds                 2
  521.        i82365             2
  522.        pcmcia_core        6    [ds i82365]
  523.  
  524.  
  525.  
  526.  
  527.   All the PCMCIA modules and the cardmgr daemon send status messages to
  528.   the system log.  This will usually be /usr/adm/messages.  This file
  529.   should be the first place to look when tracking down a problem.  When
  530.   submitting a bug report, always include the contents of this file.
  531.   Cardmgr also records some current device information for each socket
  532.   in /etc/stab.  Here is a sample /etc/stab listing:
  533.  
  534.  
  535.  
  536.        Socket 0: Adaptec APA-1460 SlimSCSI
  537.        0       aha152x_cs      0       sda     8       0
  538.        Socket 1: Serial or Modem Card
  539.        1       serial_cs       0       cua1    5       65
  540.  
  541.  
  542.  
  543.  
  544.   For the lines describing devices, the first field is the socket, the
  545.   second is the driver name, the third is used to number multiple
  546.   devices associated with the same driver, the fourth is the device
  547.   name, and the final two fields are the major and minor device numbers
  548.   for this device.
  549.  
  550.  
  551.   3.2.  How do I use my PCMCIA ethernet card?
  552.  
  553.   Linux ethernet-type network interfaces normally have names like eth0,
  554.   eth1, and so on.  The ifconfig command is used to view or modify the
  555.   state of a network interface.  A peculiarity of Linux is that network
  556.   interfaces do not have corresponding device files under /dev, so don't
  557.   be surprised when you can't find them.
  558.  
  559.   When a PCMCIA ethernet card is detected, it will be assigned the first
  560.   free interface name, which will probably be eth0.  Cardmgr will run
  561.   the /etc/pcmcia/network script to configure the interface.
  562.  
  563.   Do not configure your PCMCIA ethernet card in /etc/rc.d/rc.inet1,
  564.   since the card may not be present when this script is executed.
  565.   Comment out everything except the loopback stuff in rc.inet1.  If your
  566.   system has an automatic network configuration procedure, you should
  567.   indicate that you do not have a network card installed.  Instead, edit
  568.   the /etc/pcmcia/network.opts file to match your local network setup.
  569.   The network and network.opts scripts will be executed only when your
  570.   ethernet card is actually present.
  571.  
  572.  
  573.   3.3.  How do I use my PCMCIA modem card?
  574.  
  575.   Linux serial devices are accessed via the /dev/cua* and /dev/ttyS*
  576.   special device files.  The ttyS* devices are for incoming connections,
  577.   such as directly connected terminals.  The cua* devices are for
  578.   outgoing connections, such as modems.  The configuration of a serial
  579.   device can be examined and modified with the setserial command.
  580.  
  581.   When a PCMCIA serial or modem card is detected, it will be assigned to
  582.   the first available serial device slot.  This will usually be
  583.   /dev/cua1 or /dev/cua2, depending on the number of built-in serial
  584.   ports.  The default serial device script, /etc/pcmcia/serial, will
  585.   link the appropriate device file to /dev/modem as a convenience.
  586.  
  587.   If you are using more than one PCMCIA modem, use /etc/stab or cardinfo
  588.   to find out which device corresponds to each modem.
  589.  
  590.   Do not try to use /etc/rc.d/rc.serial to configure a PCMCIA modem.
  591.   This script should only be used to configure non-removable devices.
  592.   Modify /etc/pcmcia/serial.opts if you want to do anything special to
  593.   set up your modem.
  594.  
  595.   If a PCMCIA modem is already configured when Linux boots, it may be
  596.   incorrectly identified as an ordinary built-in serial port.  This is
  597.   harmless, however, when the PCMCIA drivers take control of the modem,
  598.   it will be assigned a different device slot.  It is best to either
  599.   parse /etc/stab or use /dev/modem, rather than expecting a PCMCIA
  600.   modem to always have the same device assignment.
  601.  
  602.  
  603.   3.4.  How do I use my PCMCIA SCSI card?
  604.  
  605.   The Qlogic FastSCSI, New Media Bus Toaster, and Adaptec APA-1460
  606.   SlimSCSI cards work under Card Services.  The PCMCIA driver modules
  607.   for these cards are built by linking some PCMCIA-specific code (in
  608.   qlogic_cs.c and toaster_cs.c) with a normal Linux SCSI driver.  The
  609.   Qlogic PCMCIA driver links with the normal QLogic driver.  The Bus
  610.   Toaster PCMCIA driver, which also supports the Adaptec SlimSCSI, links
  611.   with the Adaptec 152x driver.
  612.  
  613.   When a new SCSI host adapter is detected, the SCSI drivers will probe
  614.   for devices.  Check /usr/adm/messages to make sure your devices are
  615.   detected properly.  New SCSI devices will be assigned to the first
  616.   available SCSI device files.  The first SCSI disk will be /dev/sda,
  617.   the first SCSI tape will be /dev/st0, and the first CDROM will be
  618.   /dev/scd0.
  619.  
  620.   With 1.3.X kernels, the PCMCIA core drivers are able to find out from
  621.   the kernel which SCSI devices are connected to a card.  They will be
  622.   listed in /etc/stab, and the SCSI configuration script,
  623.   /etc/pcmcia/scsi, will be called once for each attached device, to
  624.   either configure or shut down that device.  The default script does
  625.   not take any actions to configure SCSI devices, but will properly
  626.   unmount filesystems on SCSI devices when a card is removed.
  627.  
  628.   With 1.2.X kernels, the PCMCIA drivers cannot automatically deduce
  629.   which devices are associated with a particular SCSI adapter.  Instead,
  630.   if you have one normal SCSI device configuration, you may list these
  631.   devices in /etc/pcmcia/scsi.opts.  For example, if you normally have a
  632.   SCSI disk and a CD-ROM, you would use:
  633.  
  634.  
  635.  
  636.        # For 1.2 kernels: list of attached devices
  637.        SCSI_DEVICES="sda scd0"
  638.  
  639.  
  640.  
  641.  
  642.   Always turn on SCSI devices before powering up your laptop, or before
  643.   inserting the adapter card, so that the SCSI bus is properly
  644.   terminated when the adapter is configured.  Also be very careful about
  645.   ejecting a SCSI adapter.  Be sure that all associated SCSI devices are
  646.   unmounted and closed before ejecting the card.  The best way to ensure
  647.   this is to use either cardctl or cardinfo to request card removal
  648.   before physically ejecting the card.  For now, all SCSI devices should
  649.   be powered up before plugging in a SCSI adapter, and should stay
  650.   connected until after you unplug the adapter and/or power down your
  651.   laptop.
  652.  
  653.   With 1.2.X kernels, the SCSI configuration script is called just once
  654.   to either configure or shut down a SCSI adapter.  In this situation,
  655.   the SCSI script will not be able to determine when it is safe to eject
  656.   the adapter.  It is up to the user to ensure that all SCSI devices are
  657.   closed before ejecting the card.
  658.  
  659.   There is a potential complication when using these cards that does not
  660.   arise with ordinary ISA bus adapters.  The SCSI bus carries a
  661.   ``termination power'' signal that is necessary for proper operation of
  662.   ordinary passive SCSI terminators.  PCMCIA SCSI adapters do not supply
  663.   termination power, so if it is required, an external device must
  664.   supply it.  Some external SCSI devices may be configured to supply
  665.   termination power.  Others, such as the Zip Drive and the Syquest EZ-
  666.   Drive, use active terminators that do not depend on it.  In some
  667.   cases, it may be necessary to use a special terminator block such as
  668.   the APS SCSI Sentry 2, which has an external power supply.  When
  669.   configuring your SCSI device chain, be aware of whether or not any of
  670.   your devices require or can provide termination power.
  671.  
  672.   The Adaptec APA-460 SlimSCSI adapter is not supported.  This card was
  673.   originally sold under the Trantor name, and when Adaptec merged with
  674.   Trantor, they continued to sell the Trantor card with an Adaptec
  675.   label.  The APA-460 is not compatible with any existing Linux driver.
  676.   I'm not sure how hard it would be to write a driver; I don't think
  677.   anyone has been able to obtain the technical information from Adaptec.
  678.  
  679.   The (unsupported) Trantor SlimSCSI can be identified by the following:
  680.  
  681.  
  682.  
  683.        Trantor / Adaptec APA-460 SlimSCSI
  684.        FCC ID: IE8T460
  685.        Shipped with SCSIworks! driver software
  686.  
  687.  
  688.  
  689.  
  690.   The (supported) Adaptec SlimSCSI can be identified by the following:
  691.  
  692.  
  693.  
  694.        Adaptec APA-1460 SlimSCSI
  695.        FCC ID: FGT1460
  696.        P/N: 900100
  697.        Shipped with EZ-SCSI driver software
  698.  
  699.  
  700.  
  701.  
  702.  
  703.   3.5.  How do I use my PCMCIA memory card?
  704.  
  705.   The default memory card startup script will create block and character
  706.   devices for accessing a card's first common memory and attribute
  707.   memory regions.  Check the man pages for all the details, but the
  708.   devices you'll probably be using will be /dev/mem0c (character device)
  709.   or /dev/mem0b (block device).  The block device is used for disk-like
  710.   access (creating and mounting filesystems, etc).  The character device
  711.   is for "raw" reads and writes at arbitrary locations.
  712.  
  713.   To use a flash memory card as an ordinary disk-like block device,
  714.   first create a ``flash translation layer'' partition on the device
  715.   with the ftl_format command:
  716.  
  717.  
  718.  
  719.        ftl_format -i /dev/mem0c
  720.  
  721.  
  722.  
  723.  
  724.   Note that this command accesses the card through the ``raw'' memory
  725.   card interface.  Once formatted, the card can be accessed as an
  726.   ordinary block device via the ftl_cs driver.  For example:
  727.        mke2fs /dev/ftl0
  728.        mount -t ext2 /dev/ftl0 /mnt
  729.  
  730.  
  731.  
  732.  
  733.   There are two major formats for flash memory cards: the ``flash
  734.   translation layer'' style, and the Microsoft Flash File System.  The
  735.   FTL format is generally more flexible because it allows any ordinary
  736.   high-level filesystem (ext2, ms-dos, etc) to be used on a flash card
  737.   as if it were an ordinary disk device.  The FFS is a complete new
  738.   filesystem type.  Linux cannot currently handle cards formated with
  739.   FFS.
  740.  
  741.  
  742.   3.6.  How do I tell cardmgr how to identify a new card?
  743.  
  744.   Assuming that your card is supported by an existing driver, all that
  745.   needs to be done is to add an entry to /etc/pcmcia/config to tell
  746.   cardmgr how to identify the card, and which driver(s) need to be
  747.   linked up to this card.  Check the man page for pcmcia for more
  748.   information about the config file format.  If you insert an unknown
  749.   card, cardmgr will normally record some identification information in
  750.   /usr/adm/messages that can be used to construct the config entry.
  751.  
  752.   Here is an example of how cardmgr will report an unsupported card in
  753.   /usr/adm/messages.
  754.  
  755.  
  756.  
  757.        cardmgr[460]: unsupported card in socket 1
  758.        cardmgr[460]: version info: "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  759.  
  760.  
  761.  
  762.  
  763.   The corresponding entry in /etc/pcmcia/config would be:
  764.  
  765.  
  766.  
  767.        card "Megahertz XJ2288 V.34 Fax Modem"
  768.          version "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  769.          bind "serial_cs"
  770.  
  771.  
  772.  
  773.  
  774.   You can use ``*'' to match strings that don't need to match exactly,
  775.   like version numbers.  When making new config entries, be careful to
  776.   copy the strings exactly, preserving case and blank spaces.  Also be
  777.   sure that the config entry has the same number of strings as are
  778.   reported in the log file.
  779.  
  780.   After editing /etc/pcmcia/config, you can signal cardmgr to reload the
  781.   file with:
  782.  
  783.  
  784.  
  785.        kill -HUP `cat /var/run/cardmgr.pid`
  786.  
  787.  
  788.  
  789.  
  790.   If you do set up an entry for a new card, please send me a copy so
  791.   that I can include it in the standard config file.
  792.  
  793.   3.7.  How do I control which interrupts and ports are used by a
  794.   device?
  795.  
  796.   In theory, it should not really matter which interrupt is allocated to
  797.   which device, as long as two devices are not configured to use the
  798.   same interrupt.  In /etc/pcmcia/config.opts you'll find a place for
  799.   excluding interrupts that are used by non-PCMCIA devices.
  800.  
  801.   Note that the interrupt used to monitor card status changes is chosen
  802.   by the low-level socket driver module (i82365 or tcic) before cardmgr
  803.   parses /etc/pcmcia/config, so it is not affected by changes to this
  804.   file.  To set this interrupt, use the irq_mask or cs_irq options when
  805.   the socket driver is loaded, in /etc/rc.d/rc.pcmcia.
  806.  
  807.   All the client card drivers have a parameter called irq_mask for
  808.   specifying which interrupts they may try to allocate.  Each bit of
  809.   irq_mask corresponds to one irq line: bit 0 is irq 0, bit 1 is irq 1,
  810.   and so on.  So, a mask of 0x1200 would correspond to irq 9 and irq 12.
  811.   To limit a driver to use only one specific interrupt, its irq_mask
  812.   should have only one bit set.  These driver options should be set in
  813.   your /etc/pcmcia/config file.  For example:
  814.  
  815.  
  816.  
  817.        device "serial_cs"
  818.          module "serial_cs" opts "irq_mask=0x1100"
  819.          ...
  820.  
  821.  
  822.  
  823.  
  824.   would specify that the serial driver should only use irq 8 or irq 12.
  825.   Note that Card Services will never allocate an interrupt that is
  826.   already in use by another device, or an interrupt that is excluded in
  827.   the config file.
  828.  
  829.   There is no way to directly specify the I/O addresses for a PCMCIA
  830.   card to use.  The /etc/pcmcia/config.opts file allows you to specify
  831.   ranges of ports available for use by all PCMCIA devices.
  832.  
  833.   After modifying /etc/pcmcia/config, you can restart cardmgr with
  834.   ``kill -HUP''.
  835.  
  836.  
  837.   3.8.  When is it safe to insert or eject a PCMCIA card?
  838.  
  839.   In theory, you can insert and remove PCMCIA cards at any time.
  840.   However, it is a good idea not to eject a card that is currently being
  841.   used by an application program.  Kernels older than 1.1.77 would often
  842.   lock up when serial/modem cards were ejected, but this should be fixed
  843.   now.
  844.  
  845.  
  846.   3.9.  How do I unload PCMCIA drivers?
  847.  
  848.   To unload the entire PCMCIA package, invoke rc.pcmcia with:
  849.  
  850.  
  851.  
  852.        /etc/rc.d/rc.pcmcia stop
  853.  
  854.  
  855.  
  856.  
  857.   This script will take several seconds to run, to give all client
  858.   drivers time to shut down gracefully.  If a PCMCIA device is currently
  859.   in use, the shutdown will fail.
  860.  
  861.  
  862.   3.10.  How does Card Services deal with suspend/resume?
  863.  
  864.   Card Services can be compiled with support for APM (Advanced Power
  865.   Management) if you've installed this package on your system.  The
  866.   current release of Stephen Rothwell's APM support package is version
  867.   0.5.  Unlike the 0.4 release, 0.5 does not require a special patch to
  868.   work with PCMCIA.  The PCMCIA modules will automatically be configured
  869.   for APM if a compatible version is detected on your system.
  870.  
  871.   Without resorting to APM, you can do ``cardctl suspend'' before
  872.   suspending your laptop, and ``cardctl resume'' after resuming, to
  873.   properly shut down and restart your PCMCIA cards.  This will not work
  874.   with a PCMCIA modem that is in use, because the serial driver isn't
  875.   able to save and restore the modem operating parameters.
  876.  
  877.   APM seems to be unstable on some systems.  If you experience trouble
  878.   with APM and PCMCIA on your system, try to narrow down the problem to
  879.   one package or the other before reporting a bug.
  880.  
  881.   APM is currently being maintained by Rick Faith ().
  882.  
  883.  
  884.   3.11.  How do I turn off a PCMCIA card without ejecting it?
  885.  
  886.   Use either the cardctl or cardinfo command.  ``cardctl suspend #''
  887.   will suspend one socket, and turn off its power.  The corresponding
  888.   resume command will wake up the card in its previous state.
  889.  
  890.  
  891.   4.  Problems with specific cards
  892.  
  893.   4.1.  Why doesn't my modem work?
  894.  
  895.   That's a broad question, but here's a quick troubleshooting guide.
  896.  
  897.  
  898.   o  Is your card recognized as a modem?  Check /usr/adm/messages and
  899.      make sure that cardmgr identifies the card correctly and starts up
  900.      the serial_cs driver.  If it doesn't, you may need to add a new
  901.      entry to your /etc/pcmcia/config file so that it will be identified
  902.      properly.  See section ``3.6'' for details.
  903.  
  904.   o  Is the modem configured successfully by serial_cs?  Again, check
  905.      /usr/adm/messages and look for messages from the serial_cs driver.
  906.      If you see ``register_serial() failed'', you may have an I/O port
  907.      conflict with another device.  Another tip-off of a conflict is if
  908.      the device is reported to be an 8250; most modern PCMCIA modems
  909.      should be identified as 16550A UART's.  If you think you're seeing
  910.      a port conflict, edit /etc/pcmcia/config.opts and exclude the port
  911.      range that was allocated for the modem.
  912.  
  913.   o  Is there an interrupt conflict?  If /usr/adm/messages looks good,
  914.      but the modem just doesn't seem to work, try using setserial to
  915.      change the irq to 0, and see if the modem works.  This causes the
  916.      serial driver to use a slower polled mode instead of using
  917.      interrupts.  If this seems to fix the problem, it is likely that
  918.      some other device in your system is using the interrupt selected by
  919.      serial_cs.  You should add a line to /etc/pcmcia/config.opts to
  920.      exclude this interrupt.
  921.  
  922.   o  If the modem seems to work only really, really slowly, this is an
  923.      almost certain indicator of an interrupt conflict.
  924.  
  925.   o  Make sure your problem is really a PCMCIA one.  It may help to see
  926.      if the card works under DOS with the vendor's drivers.  Also, don't
  927.      test the card with something complex like SLIP until you are sure
  928.      you can make simple connections.  If simple things work but SLIP
  929.      does not, your problem is most likely with SLIP, not with PCMCIA.
  930.  
  931.  
  932.   4.2.  Why doesn't my ethernet card work?
  933.  
  934.   Here's another quick troubleshooting guide.
  935.  
  936.  
  937.   o  Is your card recognized as an ethernet card?  Check
  938.      /usr/adm/messages and make sure that cardmgr identifies the card
  939.      correctly and starts up one of the network drivers.  If it doesn't,
  940.      your card might still be usable if it is compatible with a
  941.      supported card.  This will be most easily done if the card claims
  942.      to be "NE2000 compatible".
  943.  
  944.   o  Is the card configured properly?  If you are using a supported
  945.      card, and it was recognized by cardmgr, but still doesn't work,
  946.      there might be an interrupt or port conflict with another device.
  947.      Find out what resources the card is using (from /usr/adm/messages),
  948.      and try excluding these in /etc/pcmcia/config.opts to force the
  949.      card to use something different.
  950.  
  951.   o  If your card seems to be configured properly, but sometimes locks
  952.      up, particularly under high load, you may need to try changing your
  953.      socket driver timing parameters.  See section ``2.3'' for more
  954.      information.
  955.  
  956.   o  Make sure your problem is really a PCMCIA one.  It may help to see
  957.      see if the card works under DOS with the vendor's drivers.  Double
  958.      check your modifications to the /etc/pcmcia/network.opts script.
  959.      Make sure your drop cable, ``T'' jack, terminator, etc are working.
  960.  
  961.   Here are some comments about specific cards:
  962.  
  963.  
  964.   o  With Socket EA and 3Com 3c589 cards, you need to pick the
  965.      transceiver type (10base2, 10baseT, AUI) when the driver module is
  966.      loaded.  Make sure that the transceiver type reported in
  967.      /usr/adm/messages matches your connection.
  968.  
  969.   o  The Farallon EtherWave is actually based on the 3Com 3c589, with a
  970.      special transceiver.  Though the EtherWave uses 10baseT-style
  971.      connections, its transceiver requires that the 3c589 be configured
  972.      in 10base2 mode.
  973.  
  974.   o  If you have trouble with an IBM CCAE, NE4100, Thomas Conrad, or
  975.      Kingston adapter, try increasing the memory access time with the
  976.      mem_speed=# option to the pcnet_cs module definition.  Try speeds
  977.      of up to 1000 (in nanoseconds).
  978.  
  979.   o  For the New Media Ethernet adapter, on some systems, it may be
  980.      necessary to increase the IO port access time with the io_speed=#
  981.      option when the pcmcia_core module is loaded.  Edit CORE_OPTS in
  982.      /etc/rc.d/rc.pcmcia to set this option.
  983.  
  984.   o  The New Media Ethernet driver has a bug that causes connections to
  985.      slow down severely over time.  Currently, there is no fix for this
  986.      bug.
  987.  
  988.  
  989.  
  990.  
  991.   4.3.  How do I select the transceiver type for my 3c589 card?
  992.  
  993.   It would be nice if the driver could autodetect the difference between
  994.   a 10baseT and a 10base2 connection, but I don't know how to do that.
  995.   For now, you need to edit /etc/pcmcia/config and add an if_port=#
  996.   option to the 3c589_cs module definition.  Check the tc589_cs man page
  997.   for more details, but to select 10base2 (also known as BNC, or thin
  998.   net, or coax), change:
  999.  
  1000.  
  1001.  
  1002.        module "3c589_cs"
  1003.  
  1004.  
  1005.  
  1006.  
  1007.   to:
  1008.  
  1009.  
  1010.  
  1011.        module "3c589_cs" opts "if_port=3"
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.   4.4.  How do I add support for an NE2000-compatible ethernet card?
  1018.  
  1019.   First, see if the card is already recognized by cardmgr.  Some cards
  1020.   not listed in SUPPORTED.CARDS are actually OEM versions of cards that
  1021.   are supported.  If you find a card like this, let me know so I can add
  1022.   it to the list.
  1023.  
  1024.   If your card is not recognized, follow the instructions in section
  1025.   ``3.6'' to create a config entry for your card, but bind the card to
  1026.   the memory card driver, pcmem_cs for now.  Restart cardmgr to use the
  1027.   new updated config file.
  1028.  
  1029.   You will need to know your card's hardware ethernet address.  This
  1030.   address is a series of six two-digit hex numbers, often printed on the
  1031.   card itself.  If it is not printed on the card, you may be able to use
  1032.   a DOS driver to display the address.  In any case, once you know it,
  1033.   run:
  1034.  
  1035.  
  1036.  
  1037.        dd if=/dev/pcmem0a count=20 | od -Ax -t x1
  1038.  
  1039.  
  1040.  
  1041.  
  1042.   and search the output for your address.  Record the hex offset of the
  1043.   first byte of the address.  Now, edit modules/pcnet_cs.c and find the
  1044.   hw_info structure.  You'll need to create a new entry for your card.
  1045.   The first field is a descriptive name.  The next field is the offset
  1046.   multiplied by two.  The next three fields are the first three bytes of
  1047.   the hardware address.  The final field contains some flags for
  1048.   specific card features; to start, try setting it to 0.
  1049.  
  1050.   After editing pcnet_cs.c, compile and install the new module.  Edit
  1051.   /etc/pcmcia/config again, and change the card binding from pcmem_cs to
  1052.   pcnet_cs.  Follow the instructions for reloading the config file, and
  1053.   you should be all set.  Please send me copies of your new hw_info and
  1054.   config entries.
  1055.  
  1056.  
  1057.   If you can't find your card's hardware address in the hex dump, as a
  1058.   method of last resort, it is possible to ``hardwire'' the address when
  1059.   the pcnet_cs module is initialized.  Edit /etc/pcmcia/config and add a
  1060.   hw_addr= option, like so:
  1061.  
  1062.  
  1063.  
  1064.        module "pcnet_cs" opts "hw_addr=0x00,0x80,0xc8,0x01,0x02,0x03"
  1065.  
  1066.  
  1067.  
  1068.  
  1069.   Substitute your own card's hardware address in the appropriate spot,
  1070.   of course.
  1071.  
  1072.  
  1073.   4.5.  How do I use my PCMCIA floppy interface?
  1074.  
  1075.   The PCMCIA floppy interface used in the Compaq Aero and a few other
  1076.   laptops is not yet supported by this package.  If your laptop can
  1077.   initialize this card before Linux boots, you should be able to use it
  1078.   by telling Card Services to ignore that socket.  Note that you will
  1079.   not be able to hot swap this card.
  1080.  
  1081.   The snag in supporting the Aero floppy is that the Aero seems to use a
  1082.   proprietary PCMCIA controller to support DMA to the floppy.  Without
  1083.   knowing exactly how this is done, there isn't any way to implement
  1084.   support under Linux.
  1085.  
  1086.   To configure Card Services to ignore a socket, use the ignore=#
  1087.   parameter when you load the i82365 or tcic driver.  See the man pages
  1088.   for more details.
  1089.  
  1090.  
  1091.   4.6.  What's up with support for Xircom cards?
  1092.  
  1093.   Xircom does not share technical information about its cards without a
  1094.   non-disclosure agreement.  This means that it is not really possible
  1095.   to develop freely distributable drivers for Xircom cards without doing
  1096.   legally dubious things like reverse engineering DOS drivers.
  1097.  
  1098.   There is some indication that Xircom may start supporting Linux
  1099.   directly.  Xircom tech support says that future products will include
  1100.   Linux drivers.  Their plans for older Xircom products are less clear.
  1101.  
  1102.   The Xircom CreditCard Ethernet+Modem II card can be used as a modem
  1103.   under Linux, with no special configuration.
  1104.  
  1105.  
  1106.   5.  Debugging tips and programming information
  1107.  
  1108.   5.1.  How can I submit a helpful bug report?
  1109.  
  1110.   Here are some things that should be included in all bug reports:
  1111.  
  1112.  
  1113.   o  Your system type, and the output of the probe command
  1114.  
  1115.   o  What PCMCIA cards you are using
  1116.  
  1117.   o  Your Linux kernel version, and PCMCIA version
  1118.  
  1119.   o  The contents of the config.out file
  1120.  
  1121.   o  Any changes you've made to the startup files in /etc/pcmcia, or to
  1122.      rc.pcmcia
  1123.   o  Contents of /usr/adm/messages, even if you don't see anything that
  1124.      looks interesting.
  1125.  
  1126.   If your problem involves a kernel fault, the register dump from the
  1127.   fault is only useful if you can track down the fault address, EIP.  If
  1128.   it is in the main kernel, look up the address in System.map to
  1129.   identify the function at fault.  If the fault is in a loadable module,
  1130.   it is a bit harder to trace.  With the current module tools, ``ksyms
  1131.   -m'' will report the base address of each loadable module.  Pick the
  1132.   module that contains the EIP address, and subtract its base address
  1133.   from EIP to get an offset inside that module.  Then, run gdb on that
  1134.   module, and look up the offset with the list command.  This will only
  1135.   work if you've compiled that module with -g to include debugging
  1136.   information.
  1137.  
  1138.   Send bug reports to dhinds@allegro.stanford.edu.  I prefer to handle
  1139.   bug reports by email -- please avoid calling me at home or at work.
  1140.   You can also submit bug reports via the WWW: see
  1141.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html for details.
  1142.  
  1143.  
  1144.   5.2.  Low level PCMCIA debugging aids
  1145.  
  1146.   The PCMCIA modules contain a lot of conditionally-compiled debugging
  1147.   code.  Most of this code is under control of the PCMCIA_DEBUG
  1148.   preprocessor define.  If this is undefined, debugging code will not be
  1149.   compiled.  If set to 0, the code is compiled but inactive.  Larger
  1150.   numbers specify increasing levels of verbosity.  Each module built
  1151.   with PCMCIA_DEBUG defined will have an integer parameter, pc_debug,
  1152.   that controls the verbosity of its output.  This can be adjusted when
  1153.   the module is loaded, so output can be controlled on a per-module
  1154.   basis without recompiling.
  1155.  
  1156.   There are a few debugging tools in the debug_tools/ subdirectory of
  1157.   the PCMCIA distribution.  The dump_tcic and dump_i365 utilities
  1158.   generate complete register dumps of the PCMCIA controllers, and decode
  1159.   a lot of the register information.  They are most useful if you have
  1160.   access to a datasheet for the corresponding controller chip.  The
  1161.   dump_tuples utility lists a card's CIS (Card Information Structure),
  1162.   and decodes some of the important bits.  And the dump_cisreg utility
  1163.   displays a card's local configuration registers.
  1164.  
  1165.   The pcmem_cs memory card driver is also sometimes useful for
  1166.   debugging.  It can be bound to any PCMCIA card, and does not interfere
  1167.   with other drivers.  It can be used to directly access any card's
  1168.   attribute memory or common memory.
  1169.  
  1170.  
  1171.   5.3.  How do I write a Card Services driver for card X?
  1172.  
  1173.   The Linux PCMCIA Programmer's Guide is the best documentation for the
  1174.   Linux PCMCIA interface.  The latest version is always available from
  1175.   cb-iris.stanford.edu in /pub/pcmcia/doc.
  1176.  
  1177.   For devices that are close relatives of normal ISA devices, you'll
  1178.   probably be able to use parts of existing Linux drivers.  In some
  1179.   cases, the biggest stumbling block will be modifying an existing
  1180.   driver so that it can handle adding and removing devices after boot
  1181.   time.  Of the current drivers, the memory card driver is the only
  1182.   ``self-contained'' driver that does not depend on other parts of the
  1183.   Linux kernel to do most of the dirty work.
  1184.  
  1185.   I've written a skeleton driver with lots of comments that explains a
  1186.   lot of how a driver communicates with Card Services; you'll find this
  1187.   in the PCMCIA source distribution in modules/skeleton.c.
  1188.